Skip to content

Merge upstream apache/cassandra-java-driver 4.19.2 and bump version to 4.19.2.0#895

Draft
nikagra wants to merge 76 commits into
scylladb:scylla-4.xfrom
nikagra:scylla-4.x-merge-4.19.2
Draft

Merge upstream apache/cassandra-java-driver 4.19.2 and bump version to 4.19.2.0#895
nikagra wants to merge 76 commits into
scylladb:scylla-4.xfrom
nikagra:scylla-4.x-merge-4.19.2

Conversation

@nikagra
Copy link
Copy Markdown

@nikagra nikagra commented May 18, 2026

Closes #894

Summary

Merges changes from apache/cassandra-java-driver tag 4.19.2 into scylla-4.x and bumps the ScyllaDB driver version to 4.19.2.0-SNAPSHOT.

The last upstream merge was at Apache tag 4.19.0 (PR #467).

Upstream changes (4.19.0 → 4.19.2)

4.19.0 → 4.19.1

  • CASSJAVA-80 — Support configuration to disable DNS reverse-lookups for SAN validation
  • CASSJAVA-90 — Update native-protocol version
  • CASSJAVA-40 — Driver testing against Java 21
  • CASSJAVA-102 — Fix revapi spurious complaints about optional dependencies
  • CASSJAVA-97 — Let users inject an ID for each request and write to the custom payload
  • CASSJAVA-92 — Local DC provided for nodetool clientstats
  • CASSJAVA-89 — Support schema options that changed in Cassandra 5.0
  • Upgrade Netty to 4.1.119
  • Add SubnetAddressTranslator for IP translation on private networks
  • Remove unnecessary locking in DefaultNettyOptions
  • Eliminate lock in ConcurrencyLimitingRequestThrottler

4.19.1 → 4.19.2

  • CASSJAVA-116 — Retry or Speculative Execution with RequestIdGenerator throws "Duplicate Key"

Conflict resolution notes

  • Removed Apache-specific infrastructure files: .asf.yaml, Jenkinsfile-datastax, Jenkinsfile-asf, ci/create-user.sh, ci/run-tests.sh
  • Kept ScyllaDB groupId (com.scylladb) and removed <parent>org.apache/apache</parent>
  • Kept ScyllaDB's more up-to-date library versions (netty, jackson, etc.)
  • Took upstream's lock-free ConcurrencyLimitingRequestThrottler implementation
  • Kept ScyllaDB's shard-aware channel logic in CqlRequestHandler
  • Kept BackendType.SCYLLA and ScyllaDB-specific test infrastructure
  • Kept ScyllaDB's CCM/Scylla version handling in CcmBridge

lukasz-antoniak and others added 30 commits June 3, 2024 13:48
patch by Lukasz Antoniak; reviewed by Andy Tolbert, and Bret McGuire for CASSANDRA-19635
patch by Lukasz Antoniak; reviewed by Bret McGuire for CASSANDRA-19635
Those repeated calls account for a non-negligible portion of my application
CPU (0.6%) and can definitly be a final field so that it gets resolved only
once per CqlRequestHandler.

patch by Benoit Tellier; reviewed by Andy Tolbert, and Bret McGuire
reference: apache#1623
patch by Stefan Miklosovic; reviewed by Michael Semb Wever for CASSANDRA-19854
DefaultBoundStatement#getRoutingKey has logic to infer the
routing key when no one has explicitly called setRoutingKey
or otherwise set the routing key on the statement.
It however doesn't check for cases where nothing has been
bound yet on the statement.
This causes more problems if the user decides to get a
BoundStatementBuilder from the PreparedStatement, set some
fields on it, and then copy it by constructing new
BoundStatementBuilder objects with the BoundStatement as a
parameter, since the empty ByteBuffer gets copied to all
bound statements, resulting in all requests being targeted
to the same Cassandra node in a token-aware load balancing
policy.

patch by Ammar Khaku; reviewed by Andy Tolbert, and Bret McGuire
reference: apache#1620
…ted future

patch by Lukasz Antoniak; reviewed by Andy Tolbert, and Bret McGuire for JAVA-3167
patch by Lukasz Antoniak; reviewed by Bret McGuire
reference: apache#1955
…allow subsequent tests to run

patch by Henry Hughes; reviewed by Alexandre Dutra and Andy Tolbert for JAVA-3117
patch by Lukasz Antoniak; reviewed by Andy Tolbert and Chris Lohfink for JAVA-3149
patch by Lukasz Antoniak; reviewed by Bret McGuire
reference: apache#1939
It might take some (small) time for callback handling when the
throttler request proceeds to submission.

Before this change, the throttler proceed request will happen while
holding the lock, preventing other tasks from proceeding when there is
spare capacity and even preventing tasks from enqueuing until the
callback completes.

By tracking the expected outcome, we can perform the callback outside
of the lock. This means that request registration and submission can
proceed even when a long callback is being processed.

patch by Jason Koch; Reviewed by Andy Tolbert and Chris Lohfink for CASSANDRA-19922
…kReturnValue

Since the driver's default implementation is for
BatchStatement and SimpleStatement methods to be immutable,
we should annotate those methods with @CheckReturnValue.
Statement#setNowInSeconds implementations are immutable so
annotate that too.

patch by Ammar Khaku; reviewed by Andy Tolbert and Bret McGuire
reference: apache#1607
patch by Bret McGuire; reviewed by Andy Tolbert and Alexandre Dutra
reference: apache#1962
after exceeding max orphan ids

patch by Christian Aistleitner; reviewed by Andy Tolbert, and Bret McGuire for apache#1938
 patch by Siyao (Jane) He; reviewed by Mick Semb Wever for CASSANDRA-19832
patch by Lukasz Antoniak; reviewed by Bret McGuire and Chris Lohfink
patch by Abe Ratnofsky; reviewed by Andy Tolbert and Chris Lohfink for CASSANDRA-20001
patch by Bret McGuire; reviewed by Bret McGuire and Andy Tolbert for CASSANDRA-19930
If super.after() throws an Exception `CURRENT` flag is never dropped
which leads next tests to fail with IllegalStateException("Attempting to use a Ccm rule while another is in use.  This is disallowed")

Patch by Dmitry Kropachev; reviewed by Andy Tolbert and Bret McGuire for JAVA-3117
patch by Jane He; reviewed by Alexandre Dutra and Bret McGuire for JAVA-3051
 patch by Siyao (Jane) He; reviewed by Mick Semb Wever for CASSJAVA-25
… with DataStax HCD 1.0.0

patch by Lukasz Antoniak; reviewed by Bret McGuire
reference: apache#1958
patch by Stefan Miklosovic; reviewed by Bret McGuire for CASSJAVA-2
…assandra versions.

patch by Bret McGuire; reviewed by Bret McGuire for CASSJAVA-54
Updating the link to Jira.

Previously we had a component in the CASSANDRA Jira project but now we have a project for each driver - in the case of Java, it's CASSJAVA.

Added CASSJAVA to .asf.yaml

patch by Jeremy Hanna; reviewed by Bret McGuire for CASSJAVA-61
patch by Lukasz Antoniak; reviewed by Alexandre Dutra and Bret McGuire for CASSJAVA-52
patch by Ammar Khaku; reviewed by Andy Tolbert and Bret McGuire
reference: apache#1635
With some sysprops enabled this will actually be respected which completely borks Astra routing.

patch by Bret McGuire; reviewed by Alexandre Dutra and Bret McGuire for CASSJAVA-55
jasonk000 and others added 15 commits July 28, 2025 12:39
This value is initialized at constructor time and marked final, so it
can never change. There is no need to have access to this reference
synchronized.

Patch by Jason Koch; reviewed by Alexandre Dutra, Andy Tolbert and Jane He
Patch by Michael Karsten; reviewed by Abe Ratnofsky and Andy Tolbert for CASSJAVA-89
Following from 6d3ba47 this changes the throttler to a complete
lock-free implementation. Update the related comments and README now
that it is lock-free.

Patch by Jason Koch; reviewed by Alexandre Dutra and Andy Tolbert
patch by Ivan Sopov; reviewed by Bret McGuire
reference: apache#2049
patch by Kefu Chai; reviewed by Andy Tolbert and Bret McGuire
reference: apache#1940
patch by Lukasz Antoniak; reviewed by Bret McGuire and Abe Ratnofsky for CASSJAVA-92
… custom payload

patch by Jane He; reviewed by Abe Ratnofsky and Bret McGuire for CASSJAVA-97
patch by Bret McGuire; reviewed by Andy Tolbert
…throws "Duplicate Key"

patch by Jane He; reviewed by Andy Tolbert and Lukasz Atoniak for CASSJAVA-116
patch by Bret McGuire; reviewed by Lukasz Antoniak and Andy Tolbert
reference: apache#2062
…thub.com/apache/cassandra-java-driver into scylla-4.x-merge-4.19.2

Following conflict resolutions and additional changes were made:
- Removed Apache-specific infrastructure files: .asf.yaml, Jenkinsfile-datastax,
  Jenkinsfile-asf, ci/create-user.sh, ci/run-tests.sh
- Kept ScyllaDB groupId (com.scylladb) and version (4.19.0.10-SNAPSHOT) in pom.xml files
- Kept ScyllaDB's more up-to-date library versions (netty, jackson, etc.)
- Removed <parent>org.apache/apache</parent> from root pom.xml
- Took upstream's lock-free ConcurrencyLimitingRequestThrottler implementation
- Took upstream's CASSJAVA-80: SSL_ALLOW_DNS_REVERSE_LOOKUP_SAN config option
- Took upstream's CASSJAVA-92: local DC in nodetool clientstats
- Took upstream's CASSJAVA-97: RequestIdGenerator support
- Took upstream's CASSJAVA-89: schema options for Cassandra 5.0
- Took upstream's SubnetAddressTranslator
- Kept ScyllaDB's shard-aware channel logic in CqlRequestHandler
- Kept BackendType.SCYLLA and ScyllaDB-specific test infrastructure
- Kept ScyllaDB's CCM/Scylla version handling in CcmBridge
- Kept ScyllaDB's README and documentation
@nikagra nikagra marked this pull request as draft May 18, 2026 21:44
@nikagra nikagra force-pushed the scylla-4.x-merge-4.19.2 branch 10 times, most recently from 7d42eee to 178e47c Compare May 19, 2026 22:44
- BasicLoadBalancingPolicy: add missing closing brace for getLocalRack()
- DefaultLoadBalancingPolicy: remove unused ThreadLocalRandom import
- OptionalLocalDcHelper: add missing LinkedHashSet import; restore correct
  checkLocalDatacenterCompatibility implementation from upstream
- InitialNodeListRefresh: add missing Set import; add contactPoints field
  and constructor arg; restore upstream compute() logic
- InitialNodeListRefreshTest: replace bad merge artifact with upstream
  4.19.2 version (contactPoint1/contactPoint2 setup + ImmutableSet args)
- CqlRequestHandler: rename logPrefix -> handlerLogPrefix in sendRequest()
  calls to session.getChannel()
- manual/core/README.md: add request_id/* to toctree
@nikagra nikagra force-pushed the scylla-4.x-merge-4.19.2 branch from 178e47c to bbc972c Compare May 19, 2026 23:20
@nikagra nikagra requested a review from Copilot May 20, 2026 13:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR merges upstream apache/cassandra-java-driver changes up to tag 4.19.2 into the ScyllaDB fork branch and bumps the fork’s version to 4.19.2.0-SNAPSHOT, bringing in upstream fixes/features such as request ID generation, SAN reverse-lookup configurability, lock-free throttling, and new address translation utilities.

Changes:

  • Bump all module versions to 4.19.2.0-SNAPSHOT and update build tooling (revapi plugin + config wiring, JDK21 test profile).
  • Add/merge upstream core features: request-id generator plumbing, SSL SAN reverse-lookup toggle, startup “driver baggage” (LBP metadata), lock-free request throttler, and new address translation helpers (Subnet translator, parsing utilities).
  • Add/adjust tests and documentation to cover the new behaviors (request-id, subnet translator config, schema option changes).

Reviewed changes

Copilot reviewed 87 out of 88 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
test-infra/revapi.json Revapi API-compat configuration adjustments.
test-infra/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
README.md Minor formatting/whitespace normalization.
query-builder/src/test/java/com/datastax/oss/driver/api/querybuilder/schema/CreateTableTest.java Add coverage for new compression option variants.
query-builder/src/test/java/com/datastax/dse/driver/api/querybuilder/schema/CreateDseTableTest.java Add compression option coverage + crc_check_chance option coverage.
query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/schema/RelationOptions.java Add crc_check_chance option + new compression APIs; deprecate legacy ones.
query-builder/revapi.json Revapi ignore rules update for query-builder module.
query-builder/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
pom.xml Root version bump; revapi plugin upgrade/config; add enforcer plugin; add JDK21 test profile.
osgi-tests/src/test/java/com/datastax/oss/driver/internal/osgi/support/BundleOptions.java OSGi test bundle provisioning updates.
osgi-tests/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
metrics/microprofile/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
metrics/micrometer/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
mapper-runtime/revapi.json Revapi config tweak (regex escaping) + ignore list changes.
mapper-runtime/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
mapper-processor/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
manual/core/request_id/README.md New manual section documenting request-id feature.
manual/core/README.md Link the new request-id manual section.
manual/core/non_blocking/README.md Update throttler lock-freedom guidance to reflect lock-free throttler changes.
manual/core/address_resolution/README.md Document FixedHostName and Subnet address translators.
integration-tests/src/test/java/com/datastax/oss/driver/querybuilder/RelationOptionsIT.java New IT verifying crc_check_chance + compression option behavior across Cassandra versions.
integration-tests/src/test/java/com/datastax/oss/driver/core/tracker/RequestNodeLoggerExample.java Rename log prefix parameter for clarity (node vs session request prefix).
integration-tests/src/test/java/com/datastax/oss/driver/core/tracker/RequestIdGeneratorIT.java New IT coverage for request-id generator + custom payload behavior.
integration-tests/src/test/java/com/datastax/oss/driver/core/ssl/DefaultSslEngineFactoryIT.java New IT asserting SAN hostname resolution respects reverse-lookup config.
integration-tests/src/test/java/com/datastax/oss/driver/core/cql/PreparedStatementCachingIT.java Adjust test prepare-cache behavior (avoid explicit CacheBuilder dependency).
integration-tests/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
guava-shaded/pom.xml Version bump + make guava optional + build-helper logic to skip recompilation outside Java 8.
examples/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
distribution/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
distribution-tests/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
distribution-source/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
core/src/test/java/com/datastax/oss/driver/internal/core/util/ArrayUtilsTest.java Update shuffle tests to mock Random instead of ThreadLocalRandom.
core/src/test/java/com/datastax/oss/driver/internal/core/type/codec/VectorCodecTest.java Simplify array duplication using commons ArrayUtils.
core/src/test/java/com/datastax/oss/driver/internal/core/tracker/RequestIdGeneratorTest.java New unit tests for UUID/W3C request id generators.
core/src/test/java/com/datastax/oss/driver/internal/core/cql/RequestHandlerTestHarness.java Add request-id generator support in harness/context mocks.
core/src/test/java/com/datastax/oss/driver/internal/core/cql/QueryTraceFetcherTest.java Make InetAddress deterministic (loopback) instead of mock.
core/src/test/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandlerRetryTest.java New regression test for retry + request-id generator “duplicate key” scenario.
core/src/test/java/com/datastax/oss/driver/internal/core/context/StartupOptionsBuilderTest.java Add tests for startup “driver baggage” including local DC / LBP details.
core/src/test/java/com/datastax/oss/driver/internal/core/context/MockedDriverContextFactory.java Enhance factory to support multiple profiles and mock LBPs for startup baggage tests.
core/src/test/java/com/datastax/oss/driver/internal/core/context/DefaultDriverContextTest.java Update factory usage after MockedDriverContextFactory changes.
core/src/test/java/com/datastax/oss/driver/internal/core/ContactPointsTest.java Update warning message expectations for contact point parsing.
core/src/test/java/com/datastax/oss/driver/internal/core/config/typesafe/TypesafeDriverConfigTest.java Add coverage for string-map keys that include forward slashes.
core/src/test/java/com/datastax/oss/driver/internal/core/config/MockOptions.java Add SUBNET_ADDRESSES option for tests.
core/src/test/java/com/datastax/oss/driver/internal/core/addresstranslation/SubnetTest.java New tests for Subnet CIDR parsing/contains logic.
core/src/test/java/com/datastax/oss/driver/internal/core/addresstranslation/SubnetAddressTranslatorTest.java New tests for SubnetAddressTranslator behavior and validation.
core/src/test/java/com/datastax/oss/driver/internal/core/addresstranslation/SubnetAddressTest.java New tests for overlap detection.
core/src/test/java/com/datastax/oss/driver/internal/core/addresstranslation/FixedHostNameAddressTranslatorTest.java Update to use DefaultDriverOption constant and new context factory signature.
core/src/main/resources/reference.conf Add config knobs for SAN reverse-lookup and request-id generator; document SubnetAddressTranslator config.
core/src/main/java/com/datastax/oss/driver/internal/core/util/ArrayUtils.java Accept Random in shuffleHead overload (testability).
core/src/main/java/com/datastax/oss/driver/internal/core/util/AddressUtils.java New helper to parse host:port (optionally resolve) used by contact points and subnet translator.
core/src/main/java/com/datastax/oss/driver/internal/core/type/codec/registry/DefaultCodecRegistry.java Optimize CacheKey.hashCode() to avoid allocations.
core/src/main/java/com/datastax/oss/driver/internal/core/tracker/W3CContextRequestIdGenerator.java New W3C trace-context request id generator.
core/src/main/java/com/datastax/oss/driver/internal/core/tracker/UuidRequestIdGenerator.java New UUID-based request id generator.
core/src/main/java/com/datastax/oss/driver/internal/core/tracker/RequestLogger.java Rename log prefix parameter to distinguish session vs node scopes.
core/src/main/java/com/datastax/oss/driver/internal/core/tracker/NoopRequestTracker.java Rename log prefix parameters to match new semantics.
core/src/main/java/com/datastax/oss/driver/internal/core/tracker/MultiplexingRequestTracker.java Propagate renamed log prefix parameter through multiplexing tracker.
core/src/main/java/com/datastax/oss/driver/internal/core/ssl/SniSslEngineFactory.java Add toggle to avoid DNS reverse lookups when selecting SAN host.
core/src/main/java/com/datastax/oss/driver/internal/core/ssl/DefaultSslEngineFactory.java Add SAN hostname resolution toggle + test hooks; use configured hostname selection.
core/src/main/java/com/datastax/oss/driver/internal/core/session/throttling/ConcurrencyLimitingRequestThrottler.java Replace lock-based coordination with lock-free queue/counters.
core/src/main/java/com/datastax/oss/driver/internal/core/metadata/SniEndPoint.java Prevent integer overflow in round-robin offset for address selection.
core/src/main/java/com/datastax/oss/driver/internal/core/loadbalancing/helper/OptionalLocalDcHelper.java Add checks/warnings for local DC mismatches with contact points; expose configuredLocalDc().
core/src/main/java/com/datastax/oss/driver/internal/core/loadbalancing/DefaultLoadBalancingPolicy.java Add startup configuration output (for driver baggage).
core/src/main/java/com/datastax/oss/driver/internal/core/loadbalancing/BasicLoadBalancingPolicy.java Add startup configuration output and safer default for routing method parsing.
core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlRequestHandler.java Integrate request-id generator into per-request logging/tracking and statement decoration.
core/src/main/java/com/datastax/oss/driver/internal/core/cql/CqlPrepareAsyncProcessor.java Clarify/adjust behavior for cached completed futures vs defensive copies.
core/src/main/java/com/datastax/oss/driver/internal/core/context/StartupOptionsBuilder.java Add DRIVER_BAGGAGE startup option built from load balancing startup configuration.
core/src/main/java/com/datastax/oss/driver/internal/core/context/DefaultNettyOptions.java Remove unnecessary synchronization from getTimer().
core/src/main/java/com/datastax/oss/driver/internal/core/context/DefaultDriverContext.java Add request-id generator wiring; make startup options built dynamically per call.
core/src/main/java/com/datastax/oss/driver/internal/core/ContactPoints.java Refactor contact point parsing to AddressUtils + improve logging around invalid specs.
core/src/main/java/com/datastax/oss/driver/internal/core/addresstranslation/SubnetAddressTranslator.java New subnet-based address translator implementation.
core/src/main/java/com/datastax/oss/driver/internal/core/addresstranslation/SubnetAddress.java New subnet-to-address mapping helper.
core/src/main/java/com/datastax/oss/driver/internal/core/addresstranslation/Subnet.java New CIDR subnet parsing/contains implementation.
core/src/main/java/com/datastax/oss/driver/internal/core/addresstranslation/FixedHostNameAddressTranslator.java Use DefaultDriverOption constant for advertised-hostname config.
core/src/main/java/com/datastax/oss/driver/api/core/tracker/RequestTracker.java Clarify session-request vs node-request tracker callbacks + renamed parameter semantics.
core/src/main/java/com/datastax/oss/driver/api/core/tracker/RequestIdGenerator.java New public API for request-id generation + default statement decoration into custom payload.
core/src/main/java/com/datastax/oss/driver/api/core/ssl/ProgrammaticSslEngineFactory.java Add allowDnsReverseLookupSan option for programmatic SSL engine factory.
core/src/main/java/com/datastax/oss/driver/api/core/session/throttling/RequestThrottler.java Update documentation regarding lock-free vs lock-based throttlers.
core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java Add programmatic request-id generator support; default generator for secure connect bundles.
core/src/main/java/com/datastax/oss/driver/api/core/session/ProgrammaticArguments.java Add storage/accessors for programmatic request-id generator.
core/src/main/java/com/datastax/oss/driver/api/core/loadbalancing/LoadBalancingPolicy.java Add default startup configuration map hook.
core/src/main/java/com/datastax/oss/driver/api/core/context/DriverContext.java Expose optional request-id generator from the context.
core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java Add typed options for new SSL/request-id/address-translator settings.
core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java Add new config keys for SAN reverse lookup, request id generator, and subnet translator.
core/revapi.json Update revapi ignores for new API surface and optional dependency noise.
core/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
core-shaded/pom.xml Version bump to 4.19.2.0-SNAPSHOT.
changelog/README.md Add 4.19.1 and 4.19.2 changelog entries.
bom/pom.xml Version bump across BOM-managed artifacts.
Comments suppressed due to low confidence (1)

osgi-tests/src/test/java/com/datastax/oss/driver/internal/osgi/support/BundleOptions.java:44

  • commonBundles() now references java-driver-guava-shaded under groupId org.apache.cassandra, but this fork's modules (and parent POM) use com.scylladb. This will make the OSGi test provision the wrong artifact (or fail to resolve it). Update the groupId back to com.scylladb (or ensure the project actually publishes the org.apache.cassandra coordinates).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test-infra/revapi.json
Comment thread query-builder/revapi.json
Comment thread mapper-runtime/revapi.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Merge upstream apache/cassandra-java-driver 4.19.2 and bump version to 4.19.2.0